package com.qianyucc.blog.controller.comm;

import com.qianyucc.blog.mapper.*;
import com.qianyucc.blog.model.entity.*;
import com.qianyucc.blog.model.pojo.*;
import com.qianyucc.blog.model.vo.*;
import com.qianyucc.blog.service.*;
import io.swagger.annotations.*;
import lombok.extern.slf4j.*;
import org.springframework.beans.factory.annotation.*;
import org.springframework.web.bind.annotation.*;

import java.util.*;

/**
 * @author lijing
 * @date 2019-10-16 10:47
 * @description 获取blog的信息
 */
@Slf4j
@RestController("commBlogController")
@RequestMapping("/comm/blog")
public class BlogController {
    @Autowired
    private BlogService blogService;
    @Autowired
    private Configs configs;

    @ApiOperation("获取博客信息")
    @GetMapping("/info")
    public BlogInfoVO getInfo() {
        BlogInfoVO blogInfo = blogService.getBlogInfo();
        return blogInfo;
    }

    @ApiOperation("获取博客配置信息")
    @GetMapping("/profile")
    public ProfileVO profile() {
        return ProfileVO.create(configs);
    }
}
